import axios from 'axios';
import {
  constances
} from './index';

const changeList = (data) => ({
  data,
  type: constances.CHANGE_LIST
});

export const getListData = () => {
  return (dispatch) => {
    axios.get('/api/getListData.json').then(res => {
      const data = res.data;
      dispatch(changeList(data.data))
    }).then(err => {
      console.log(err);
    });
  }
};